<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<link rel="stylesheet" href="andreas08.css" type="text/css" media="screen,projection" />
<script type="text/javascript" src="/js/page.js"></script>
<script type="text/javascript">
function new_work(id){
	var newwin = window.open_centered("dettaglio_lavoro.php?id="+id, "news", 650, 600, "");
}
</script>
<title>Intranet Docenti</title>

</head>
<body>
<div id="container" >

<div id="header">
<h1>Scuola Media E. d'Arborea - Lamarmora</h1>
<h2>area riservata ai docenti</h2>
</div>

<?php include "navigation.php" ?>

<div id="content">
<h2 style="text-align: center">Lavori pubblicati</h2>
	<table style="margin: auto; width: 100%">
            <tr>
                <td style="width: 15%; color: #003366; font-weight: bold">Autore</td>
                <td style="width: 20%; color: #003366; font-weight: bold">Titolo</td>
                <td style="width: 50%; color: #003366; font-weight: bold">Abstract</td>
                <td style="width: 5%; color: #003366; text-align: center; font-weight: bold">Classe</td>
                <td style="width: 10%; color: #003366; text-align: center; font-weight: bold">Anno</td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;&nbsp;&nbsp;</td>
            </tr>
            <?php 
            $x = 1; // contatore grafico
		    if($res_works->num_rows > $limit)
		    	$max = $limit;
		    else
		    	$max = $res_works->num_rows;
		    	
            while($row = $res_works->fetch_assoc()){
            	if($x > $limit) break;
            	if($x%2)
					$bg = "background-color: rgb(247,247,250)";
				else
					$bg = "";
            ?>
            <tr style="<?php print $bg ?>">
                <td style="width: 15%; "><a href="#" onclick="new_work(<?php print $row['id_work'] ?>)"><?php print $row['autore'] ?></a></td>
                <td style="width: 20%; color: #003366; "><a href="#" onclick="new_work(<?php print $row['id_work'] ?>)"><?php print $row['titolo'] ?></a></td>
                <td style="width: 50%; color: #003366; "><a href="#" onclick="new_work(<?php print $row['id_work'] ?>)"><?php print $row['abstract'] ?></a></td>
                <td style="width: 5%; color: #003366; text-align: center"><a href="#" onclick="new_work(<?php print $row['id_work'] ?>)"><?php print $row['classe'] ?></a></td>
                <td style="width: 10%; color: #003366; text-align: center"><a href="#" onclick="new_work(<?php print $row['id_work'] ?>)"><?php print $row['anno'] ?></a></td>
            </tr>
            <?php 
                $x++;
            }
            include $_SERVER['DOCUMENT_ROOT']."/shared/navigate.php";
            ?>
            <tr>
                <td colspan="5" style="height: 50px">&nbsp;&nbsp;&nbsp;</td>
            </tr>
            <tr>
                <td colspan="5" align="right">
                	<a href="#" onclick="new_work(0)" >Nuovo documento</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
                	<a href="#" onclick="document.location.href='index.php'">Torna al men&ugrave;</a> 
                </td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;&nbsp;&nbsp;</td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;&nbsp;&nbsp;</td>
            </tr>
        </table>


</div>
<div id="subcontent">
<?php include "menu_docs.php" ?>


</div>

<?php include "footer.php" ?>

</div>
</body>    
</html>
